(C) 1996 AROS - The Amiga Replacement OS


NAME
#include <stdio.h>
FILE * fopen()
SYNOPSIS
const char * pathname
const char * mode

FUNCTION
Opens a file with the specified name in the specified mode.

INPUTS
pathname
Path and filename of the file you want to open.
mode
How to open the file: r: Open for reading. The stream is positioned at the beginning of the file. r+: Open for reading and writing. The stream is positioned at the beginning of the file. w: Open for writing. If the file doesn't exist, then it is created. If it does already exist, then it is truncated. The stream is positioned at the beginning of the file. w+: Open for reading and writing. If the file doesn't exist, then it is created. If it does already exist, then it is truncated. The stream is positioned at the beginning of the file. a: Open for writing. If the file doesn't exist, then it is created. The stream is positioned at the end of the file. a+: Open for reading and writing. If the file doesn't exist, then it is created. The stream is positioned at the end of the file. b: Open in binary more. This has no effect and is ignored.
RESULT
A pointer to a FILE handle or NULL in case of an error. When NULL is returned, then errno is set to indicate the error.

NOTES
EXAMPLE
BUGS
Most modes are not supported right now.

SEE ALSO
fclose(), fread(), fwrite(), open(), fgets(), fgetc(), fputs(), fputc(), getc(), putc()
INTERNALS
HISTORY
14.03.1997 digulla
Forgot to advance the string pointer :-(
17.01.1997 digulla
New functions: fopen(), fclose(), fgets(), ferror(), clearerr(), fread(), fwrite(), getchar(), gets()